package game.tileMap
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import mk.gamemap.model.Player;
	
	
	public class TileMapModel extends EventDispatcher
	{
		public var view_arr:Array;
		public var tiles:Array;
		public var passage_arr:Array  
		public var mapData:MapData;
		public var mapSprites:Array;
		public var player:Player;
		
		public var maxX:int;
		public var maxY:int;
		public function TileMapModel()
		{
			setup("1")
		}
		
		public function setup(map_id:String):void{
//			@map_id = map_id
//				@map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
//				@display_x = 0
//				@display_y = 0
//				@passages = $data_system.passages
			
			
							
			setupEvents()
//			setup_scroll
//			setup_parallax
		}
		
		public function setupEvents():void{
//			
			
			mapSprites=[];
			
			player=new Player(this);
			
			
			if (player){
				trace("主角模型")
				mapSprites.push(player);
			}
			
			
		}
		
		
		
		public function setDisplayPos(x, y):void{
			/*@display_x = (x + @map.width * 256) % (@map.width * 256)
				@display_y = (y + @map.height * 256) % (@map.height * 256)
				@parallax_x = x
				@parallax_y = y*/
		}
		
		
		//位置XY是否允许通过
		public function passable(x:int, y:int, flag:int = 0x01):Boolean{
			
			
			return true;
		}
		
		
	}
}